第 2 步:很好!我们可以在控制台中看到成绩。让我们创建一个函数来一次打印每个成绩。

  • 并将Define Function with Parameter拖到HELPER FUNCTION部分。
  • 将函数名称更改为print_grades并将参数更改为list_of_grades
  • Docstring拖入print_grades 。编辑它说""" Prints grades to the console """
  • Function Call with Parameter拖到main中。将其更改为print_grades( grades )

To navigate the page using the TAB key, first press ESC to exit the code editor.

# THIS ACTIVITY IS IN PREVIEW ONLY MODE
  • Run Code
  • Submit Work
  • Next Activity
  • Show Console
  • Reset Code Editor
  • Codesters How To (opens in a new tab)